package com.wf.it.hpplan.task;

import com.wf.it.hpplan.dao.BookDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Service
public class AutoTask {
    @Autowired
    private BookDao bookDao;
    @Scheduled(cron="0/5 0 0 * * ?")
    public void autoChangeBookState(){
        System.out.println("正在运行自动化任务，把过期的预定记录改变为'已结束'");
        bookDao.updateBookState2Finish();
    }
}
